# define _CRT_SECURE_NO_WARNINGS 1
#include"string.h";
#include<string>;
namespace bit {
	void test_string1() {
		string s1("hello world");
		cout << s1.c_str() << endl;

		string s2;
		cout << s2.c_str() << endl;

		string::iterator it = s1.begin();
		while (it != s1.end()) {
			cout << *it << " ";
			it++;
		}
		cout << endl;

		for (int i = 0; i < s1.size(); i++) {
			s1[i]++;
		}

		for (auto e : s1) {
			cout << e << " ";
		}
		cout << endl;
	}
	void test_string2() {
		string s1("hhhhh");
		cout << s1.c_str() << endl;
		s1.push_back('a');
		cout << s1.c_str() << endl;
		print_str(s1);
	}
	void test_string3() {
		string s1("hello world");
		cout << s1.c_str() << endl;
		s1 += 'a';
		cout << s1.c_str() << endl;
		s1 += ' ';
		cout << s1.c_str() << endl;
		s1 += "hello   hhh";
		cout << s1.c_str() << endl;
		s1.insert(0, 's');
		cout << s1.c_str() << endl;
		s1.insert(0, 'a');
		cout << s1.c_str() << endl;
		s1.insert(0,"hahaaqqqqqeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
		cout << s1.c_str() << endl;
	}
	void test_string4() {
		string s1("hello world");
		cout << s1.c_str() << endl;


		string s2;
		s2 = s1.substr(2, 6);
		cout << s2.c_str() << endl;
	}
	void test_string5() {
		string s1("hello world");
		cout << s1 << endl;
		string s2("hello world");
		cin >> s2;
		cout << s2 << endl;
	}
	void test_string6() {
		string s1("hello world");
		cout << s1 << endl;
		string s2(s1);
		cout << s2 << endl;
	}
	void test_string7() {
		std::string s1 = std::to_string(123);
		cout << s1 << endl;
		cout << typeid(s1).name() << endl;
		int i = stoi(s1);
		cout << i << endl;
		cout << typeid(i).name() << endl;
	}
}
int main() {
	bit::test_string7();
	return 0;
}